package cn.south.campus.admin.campus.model.vo;

import cn.south.campus.admin.campus.model.entity.AdPosition;
import cn.south.campus.common.model.vo.BaseVO;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.beans.BeanUtils;

/**
 * <p>
 *
 * </p>
 *
 * @author chow
 * @since 2024/11/11 9:47
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class AdPositionVO extends BaseVO {

    /**
     * 广告位编号
     */
    private String posNo;
    /**
     * 广告位名称
     */
    private String name;
    /**
     * 描述
     */
    private String description;

    public static AdPositionVO convert(AdPosition adPosition) {
        if (adPosition == null) {
            return null;
        }
        AdPositionVO adPositionVO = new AdPositionVO();
        BeanUtils.copyProperties(adPosition, adPositionVO);
        return adPositionVO;
    }

    public static AdPosition convert(AdPositionVO adPositionVO) {
        if (adPositionVO == null) {
            return null;
        }
        AdPosition adPosition = new AdPosition();
        BeanUtils.copyProperties(adPositionVO, adPosition);
        return adPosition;
    }
}
